<extend name="Public/base"/>

<!-- 子导航 -->
<block name="sidebar">
    <include file="sidemenu" />
</block>


<block name="body">
	<!-- 标题 -->
	<div class="main-title">
		<h2>
		保密文档({$_total})
		</h2>
	</div>

	<!-- 按钮工具栏 -->
	<div class="cf">
		<div class="fl">
            <if condition="auth_check('Admin/Article/unsecret')"><button class="btn ajax-post" target-form="ids" url="{:U('Article/unsecret')}">通过保密审核</button></if>
			<if condition="auth_check('Admin/Article/del')"><button class="btn ajax-post confirm" target-form="ids" url="{:U('Article/del')}">删 除</button></if>
		</div>
	</div>


	<!-- 数据表格 -->
    <div class="data-table">
		<table class="">
    <thead>
        <tr>
		<th class="row-selected"><input class="check-all" type="checkbox"/></th>
		<th>编号</th>
		<th>标题</th>
		<th>上传用户</th>
		<th>分类</th>
		<th>最后更新</th>
		<th>操作</th>
		</tr>
    </thead>
    <tbody>
		<volist name="list" id="vo">
		<tr>
            <td><input class="ids" type="checkbox" name="ids[]" value="{$vo.id}" /></td>
			<td>{$vo.id} </td>
			<td>
			<if condition="auth_check('Admin/Article/edit')">
				<a href="{:U('Article/edit?cate_id='.$vo['category_id'].'&id='.$vo['id'])}">{$vo.title}</a>
			<else/>
				{$vo.title}
			</if>
			<td>{:get_nickname($vo['uid'])}</td>
			</td>
			<td><span>{$vo.category_id|get_cate}</span></td>
			<td><span>{$vo.update_time|time_format}</span></td>
			<td>
				<if condition="auth_check('Admin/Article/unsecret')"><a href="{:U('Article/unsecret?ids='.$vo['id'])}" class="ajax-get">通过保密审核</a></if>
				<if condition="auth_check('Admin/Article/edit')"><a href="{:U('Article/edit?cate_id='.$vo['category_id'].'&id='.$vo['id'])}">编辑</a></if>
				<if condition="auth_check('Admin/Article/del')"><a href="{:U('Article/del?ids='.$vo['id'])}" class="confirm ajax-get">删除</a></if>
            </td>
		</tr>
		</volist>
	</tbody>
    </table> 

        
	</div>

	<!-- 分页 -->
    <div class="page">
        {$_page}
    </div>
</div>

</block>
<block name="script">
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<php>if(C('COLOR_STYLE')=='blue_color') echo '<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">';</php>
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
<script type="text/javascript">
$(function(){
	//搜索功能
	$("#search").click(function(){
		var url = $(this).attr('url');
		var status = $("#sch-sort-txt").attr("data");
        var query  = $('.search-form').find('input').serialize();
        query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
        query = query.replace(/^&/g,'');
		if(status != ''){
			query += 'status=' + status + "&" + query;
        }
        if( url.indexOf('?')>0 ){
            url += '&' + query;
        }else{
            url += '?' + query;
        }
		window.location.href = url;
	});

	/* 状态搜索子菜单 */
	$(".search-form").find(".drop-down").hover(function(){
		$("#sub-sch-menu").removeClass("hidden");
	},function(){
		$("#sub-sch-menu").addClass("hidden");
	});
	$("#sub-sch-menu li").find("a").each(function(){
		$(this).click(function(){
			var text = $(this).text();
			$("#sch-sort-txt").text(text).attr("data",$(this).attr("value"));
			$("#sub-sch-menu").addClass("hidden");
		})
	});

    //回车自动提交
    $('.search-form').find('input').keyup(function(event){
        if(event.keyCode===13){
            $("#search").click();
        }
    });

    $('#time-start').datetimepicker({
        format: 'yyyy-mm-dd',
        language:"zh-CN",
	    minView:2,
	    autoclose:true
    });

    $('#datetimepicker').datetimepicker({
       format: 'yyyy-mm-dd',
        language:"zh-CN",
        minView:2,
        autoclose:true,
        pickerPosition:'bottom-left'
    })
    
})
</script>
</block>